package com.example.administrator.boltshow.viewone;/*
 *@创建者 lnn
 *@创建时间2016/8/3011:29
 *@描述 ${TODO}
*/

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.TextView;

public class LineTextView extends TextView {
    private Paint mPaint = new Paint();
    public LineTextView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        int paddingTop = getPaddingTop();
        int paddingRight = getPaddingRight();
        int paddingLeft = getPaddingLeft();
        int paddingBottom = getPaddingBottom();
        int height = getHeight();
        int width = getWidth();
        canvas.drawLine(paddingLeft,height/2,width-paddingRight,height/2,mPaint);
    }
}

